﻿using LAVAA.BL.Business;
using LAVAA.DAL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LAVAA.BL.Control
{
    public class RewardFacade
    {
        UnitOfWork _uow = new UnitOfWork();

        public IEnumerable<RewardType> getRewardTypes()
        {
            return new RewardManager(_uow).getRewardTypes();
        }

        public void AddRewardType(RewardType group)
        {
            RewardManager rewardTypeMgr = new RewardManager(_uow);
            rewardTypeMgr.AddRewardType(group);
            _uow.Commit();
        }

        public RewardType GetById(Guid id)
        {
            RewardManager rewardTypeMgr = new RewardManager(_uow);
            return rewardTypeMgr.GetById(id);
        }

        public void UpdateRewardType(RewardType reward)
        {
            RewardManager rewardTypeMgr = new RewardManager(_uow);
            rewardTypeMgr.UpdateRewardType(reward);
            _uow.Commit();
        }
    }
}
